﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<link href="${ctx.resource}/css/component/coverupload.css" rel="stylesheet">

<div class="modal-dialog x-modal-dialog" style="width:600px; margin-top: 150px;">

  <div class="modal-content">

    <div class="modal-header x-breadcrumb no-bottom-border clearfix">

      <h2><i class="glyphicon glyphicon-fire"></i>&nbsp;&nbsp;<span>添加动作组</span></h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <form class="form-horizontal" method="POST" action="${ctx.host}/year-rounds/${roundId}/batch-coursewares/${weeks}/daily-coursewares/${dailyCoursewareId}/coursewares/action-group" data-validate="true">
      
      <c:if test="${not empty type}">
        <input type="hidden" name="movementType" value="${type}">
      </c:if>
      <div class="modal-body">
        <c:if test="${empty type and coursewareType != 'course'}">
          <div class="form-group x-form-group">
            <label class="col-xs-3 control-label">动作类别</label>
            <div class="pull-left col-xs-7">
              <select name="movementType" class="form-control select2" data-validate="required">
                <option></option>
                <c:forEach var="type" items="${enums['coursewareMovementType']}">
                  <option value="${type.alias}">${type.description}</option>
                </c:forEach>
              </select>
            </div>
          </div>
        </c:if>
        <div class="form-group x-form-group">
          <label class="col-xs-3 control-label">动作组</label>
          <div class="pull-left col-xs-7">
            <select name="groupId" class="form-control select2" data-validate="required">
              <option></option>
              <c:forEach var="group" items="${persist.specialFitnessGroups}">
                <option value="${group.id}">${group.name}</option>
              </c:forEach>
            </select>
          </div>
        </div>
      </div>

      <div class="modal-footer">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
      </div>
    </form>

  </div>

</div>

<script type="text/javascript">
  $(function() {
	  
	$('select[name="movementType"]').select2({
        minimumResultsForSearch : 5,
        placeholder:'请选择动作类别',
        allowClear : true,
        width: '100%'
    });
    
    $('select[name="groupId"]').select2({
        minimumResultsForSearch : 5,
        placeholder:'请选择动作组',
        allowClear : true,
        width: '100%'
       });
  })
</script>